﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="XemNhanhTonKho.ascx.cs"
    Inherits="XemNhanhTonKho" %>
    <%@ Import Namespace="TTQT.TTQT_Code" %>
<center>
    <asp:Panel ID="pnGridMaster" runat="server" Width="700px">
        <span class="BigLabel1"></span>&nbsp;<asp:SqlDataSource ID="ds" runat="server" ConnectionString="<%$ ConnectionStrings:DBConnectionString %>"
            ProviderName="<%$ ConnectionStrings:DBConnectionString.ProviderName %>"></asp:SqlDataSource>
        &nbsp;
    </asp:Panel>
    <asp:Panel ID="pnEditMaster" runat="server" Width="700px" HorizontalAlign="Center">
    </asp:Panel>
    <asp:Panel ID="pnGridDetail" runat="server" Width="700px">
        <span class="BigLabel2">DANH SÁCH SẢN PHẨM ĐÃ KHAI BÁO</span><br />
        Lọc theo: Giới tính:
        <asp:DropDownList runat="Server" ID="cboGioiTinhLoc" AutoPostBack="True" OnSelectedIndexChanged="cboGioiTinhLoc_SelectedIndexChanged">
            <asp:ListItem Text="Tất cả" Value="-1"></asp:ListItem>
            <asp:ListItem Text="Đồ của nữ" Value="0"></asp:ListItem>
            <asp:ListItem Text="Đồ của nam" Value="1"></asp:ListItem>
        </asp:DropDownList>
        Nhóm SP
        <asp:DropDownList ID="cboNhomHangLoc" runat="server" AutoPostBack="True" DataSourceID="dsNhomHangLoc"
            DataTextField="TenNhom" DataValueField="MaNhom" 
            OnSelectedIndexChanged="cboNhomHangLoc_SelectedIndexChanged">
        </asp:DropDownList>
        <asp:SqlDataSource ID="dsNhomHangLoc" runat="server" ConnectionString="<%$ ConnectionStrings:DBConnectionString %>"
            ProviderName="<%$ ConnectionStrings:DBConnectionString.ProviderName %>" SelectCommand="NhomHang_GetByGioiTinh_Loc"
            SelectCommandType="StoredProcedure">
            <SelectParameters>
                <asp:ControlParameter ControlID="cboGioiTinhLoc" Name="gioiTinh" PropertyName="SelectedValue"
                    Type="Int32" />
            </SelectParameters>
        </asp:SqlDataSource>
        <asp:DataGrid ID="detailGrid" runat="server" AllowPaging="True" AutoGenerateColumns="False"
            OnItemCommand="detailGrid_ItemCommand" OnItemDataBound="detailGrid_ItemDataBound"
            OnPageIndexChanged="detailGrid_PageIndexChanged" Width="100%" DataSourceID="dsDetail"
            PageSize="50">
            <PagerStyle Mode="NumericPages" />
            <Columns>
                <asp:BoundColumn Visible="false" HeaderText="id" DataField="id"></asp:BoundColumn>
                <asp:BoundColumn HeaderText="seri" DataField="seri"></asp:BoundColumn>
                <asp:BoundColumn HeaderText="Ngày nhập" DataField="ngayNhap"></asp:BoundColumn>
                <asp:BoundColumn HeaderText="Nhóm hàng" DataField="TenNhom"></asp:BoundColumn>
                <asp:BoundColumn HeaderText="Tên hàng" DataField="TenHang"></asp:BoundColumn>
                <asp:TemplateColumn HeaderText="Giá bán" ItemStyle-HorizontalAlign="Right">
                    <ItemTemplate><%# TTQTCommon.ToNumberFormat(DataBinder.Eval(Container.DataItem, "GiaBanThamKhao").ToString())%></ItemTemplate>
                </asp:TemplateColumn>
                <asp:BoundColumn HeaderText="Chiết khấu" DataField="ChietKhau"></asp:BoundColumn>
                <asp:TemplateColumn>
                    <ItemTemplate>
                        <asp:Button Visible="false" CausesValidation="False" ID="cmdDelete" runat="server"
                            Text="Xóa" Width="40" CommandName="cmdDelete"></asp:Button>
                    </ItemTemplate>
                </asp:TemplateColumn>
            </Columns>
            <HeaderStyle CssClass="HeaderRow" Font-Bold="True" />
        </asp:DataGrid>
        <br />
        <asp:SqlDataSource ID="dsDetail" runat="server" ConnectionString="<%$ ConnectionStrings:DBConnectionString %>"
            ProviderName="<%$ ConnectionStrings:DBConnectionString.ProviderName %>"></asp:SqlDataSource>
    </asp:Panel>
    <asp:Panel ID="pnEditDetail" runat="server" Width="700px">
        <table width="100%" class="TableStyle" cellpadding="0" cellspacing="1">
            <tr>
                <td colspan="2" align="center">
                    <span class="BigLabel2" id="chiTietHoaDon">CHI TIẾT SẢN PHẨM</span>
                </td>
            </tr>
            <tr class="TrStyle">
                <td colspan="2" align="center">
                    &nbsp;
                </td>
            </tr>
            <tr class="TrStyle">
                <td class="TdStyle" width="120" style="text-align: left">
                    Giới tính
                </td>
                <td class="TdStyle" style="text-align: left; width: 240px;">
                    <asp:DropDownList runat="server" ID="cboGioiTinh" OnSelectedIndexChanged="cboGioiTinh_SelectedIndexChanged"
                        AutoPostBack="True" Height="25px" Width="300px">
                        <asp:ListItem Text="Đồ của nữ" Value="0"></asp:ListItem>
                        <asp:ListItem Text="Đồ của nam" Value="1"></asp:ListItem>
                    </asp:DropDownList>
                    &nbsp; &nbsp;
                </td>
            </tr>
            <tr class="TrStyle">
                <td style="height: 26px; text-align: left" width="120">
                    Nhóm hàng
                </td>
                <td style="height: 26px; text-align: left" width="120">
                    <asp:DropDownList ID="cboNhomHang" runat="server" AutoPostBack="True" DataSourceID="dsNhomHang"
                        DataTextField="TenNhom" DataValueField="Id" Height="25px" Width="300px">
                    </asp:DropDownList>
                    <asp:SqlDataSource ID="dsNhomHang" runat="server" ConnectionString="<%$ ConnectionStrings:DBConnectionString %>"
                        ProviderName="<%$ ConnectionStrings:DBConnectionString.ProviderName %>" SelectCommand="NhomHang_GetByGioiTinh"
                        SelectCommandType="StoredProcedure">
                        <SelectParameters>
                            <asp:ControlParameter ControlID="cboGioiTinh" Name="gioiTinh" PropertyName="SelectedValue"
                                Type="Int32" />
                        </SelectParameters>
                    </asp:SqlDataSource>
                    &nbsp; &nbsp;
                </td>
            </tr>
            <tr class="TrStyle">
                <td style="height: 26px; text-align: left" width="120">
                    Ngày nhập về
                </td>
                <td style="height: 26px; text-align: left" width="120">
                    <input id="txtNgayNhap" runat="server" class="TextBoxGachDuoi" onkeypress="" type="text"
                        onfocus="showCalendarControl(this);" />
                    &nbsp; &nbsp;
                </td>
            </tr>
            <tr class="TrStyle">
                <td style="height: 26px; text-align: left" width="120">
                    Tên hàng
                </td>
                <td style="height: 26px; text-align: left" width="120">
                    <asp:TextBox ID="txtTenHang" runat="server" Width="300px"></asp:TextBox>
                    &nbsp; &nbsp;
                </td>
            </tr>
            <tr class="TrStyle">
                <td style="height: 26px; text-align: left" width="120">
                    Seri
                </td>
                <td style="height: 26px; text-align: left" width="120">
                    <asp:TextBox ID="txtSeri" runat="server" Width="300px"></asp:TextBox>
                    &nbsp; &nbsp;
                </td>
            </tr>
            <tr class="TrStyle">
                <td style="height: 26px; text-align: left" width="120">
                    Giá nhập
                </td>
                <td style="height: 26px; text-align: left" width="120">
                    <asp:TextBox ID="txtGiaNhap" runat="server" Width="300px"></asp:TextBox>
                    &nbsp; &nbsp;
                </td>
            </tr>
            <tr class="TrStyle">
                <td style="height: 26px; text-align: left" width="120">
                    Giá bán
                </td>
                <td style="height: 26px; text-align: left" width="120">
                    <asp:TextBox ID="txtGiaBan" runat="server" Width="300px"></asp:TextBox>
                    &nbsp; &nbsp;
                </td>
            </tr>
            <tr class="TrStyle">
                <td style="height: 26px; text-align: left" width="120">
                    Mã vạch
                </td>
                <td style="height: 26px; text-align: left" width="120">
                    <asp:TextBox ID="txtMaVach" runat="server" Width="300px"></asp:TextBox>
                </td>
            </tr>
            <tr class="TrStyle">
                <td style="height: 34px; text-align: left" width="120">
                    Ghi chú
                </td>
                <td style="height: 34px; text-align: left">
                    <asp:TextBox ID="txtGhiChu" runat="server" TextMode="MultiLine" Width="99%" Height="100px"></asp:TextBox>
                </td>
            </tr>
            <tr class="TrStyle">
                <td colspan="2" style="height: 26px; text-align: center">
                    <asp:Label ID="lblErrorChiTiet" runat="server" ForeColor="Red"></asp:Label>
                </td>
            </tr>
            <tr class="TrStyle">
                <td colspan="2" style="height: 26px; text-align: center">
                    <asp:Button ID="cmdCapNhatDetail" runat="server" OnClick="cmdCapNhatDetail_Click"
                        Text="Cập nhật" />
                    <asp:Button ID="cmdHuyBoDetail" runat="server" Text="Hủy bỏ" OnClick="cmdHuyBoDetail_Click" />
                </td>
            </tr>
        </table>
    </asp:Panel>
</center>
